/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author 7P7
 */
@Entity
@Table(name = "RoleFunction", catalog = "NationalLevelPaperPresentation", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RoleFunction.findAll", query = "SELECT r FROM RoleFunction r"),
    @NamedQuery(name = "RoleFunction.findByRoleFuncID", query = "SELECT r FROM RoleFunction r WHERE r.roleFuncID = :roleFuncID")})
public class RoleFunction implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "RoleFuncID", nullable = false)
    private Integer roleFuncID;
    @JoinColumn(name = "RoleID", referencedColumnName = "RoleID")
    @ManyToOne
    private Role roleID;
    @JoinColumn(name = "FunctionID", referencedColumnName = "FuncID")
    @ManyToOne
    private Function functionID;

    public RoleFunction() {
    }

    public RoleFunction(Integer roleFuncID) {
        this.roleFuncID = roleFuncID;
    }

    public Integer getRoleFuncID() {
        return roleFuncID;
    }

    public void setRoleFuncID(Integer roleFuncID) {
        this.roleFuncID = roleFuncID;
    }

    public Role getRoleID() {
        return roleID;
    }

    public void setRoleID(Role roleID) {
        this.roleID = roleID;
    }

    public Function getFunctionID() {
        return functionID;
    }

    public void setFunctionID(Function functionID) {
        this.functionID = functionID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (roleFuncID != null ? roleFuncID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RoleFunction)) {
            return false;
        }
        RoleFunction other = (RoleFunction) object;
        if ((this.roleFuncID == null && other.roleFuncID != null) || (this.roleFuncID != null && !this.roleFuncID.equals(other.roleFuncID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.RoleFunction[ roleFuncID=" + roleFuncID + " ]";
    }
    
}
